Conditions | 2 |
Total Lines | 15 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | import React from 'react'; |
||
26 | |||
27 | async loadModule(oldValue: string, newValue: string) { |
||
28 | let module: typeof React.Component; |
||
29 | |||
30 | 3 | if (!this.dictionary.hasOwnProperty(newValue)) { |
|
31 | 2 | module = |
|
32 | ( |
||
33 | await import(this.pathToRoot + newValue + '.js') |
||
34 | ).default as typeof React.Component; |
||
35 | 2 | this.dictionary[newValue] = module; |
|
36 | } else { |
||
37 | 1 | module = this.dictionary[newValue]; |
|
38 | } |
||
39 | |||
40 | 3 | this.moduleState.value = module; |
|
41 | } |
||
42 | } |